﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace Prsrp
{
    /// <summary>
    /// BaseObject is the base class for any object in the game.
    /// </summary>
    public abstract class BaseObject
    {
        /*
         * This add a dispose flag for automatic garbage collection.
         * This is a one-direction method, it is by desing impossible to "undispose".
         */
        #region IDisposable

        private bool mbDisposable = false;

        /// <summary>
        /// Set dispose flag.
        /// </summary>
        public void Dispose()
        {
            mbDisposable = true;
        }

        /// <returns>
        /// Return true if current object is disposable. 
        /// </returns>
        public bool CanDispose()
        {
            return mbDisposable;
        }

        #endregion
    }
}